/**
 * Created by sa on 2016/9/26.
 */


var count = 0;
console.log('主进程开启');
var schedule = require('node-schedule');


schedule.scheduleJob('*/10 * * * * *', function(){
  capture2();
});




/*

 启动casperjs读取单个url
 */
function capture2() {
  count++;
  console.log("第"+ count +"次任务启动");

  var exec = require('child_process').exec
  exec('casperjs sougou.js', function (error, stdout, stderr) {
    if (error) {
      console.error(error);
      return;
    }
    console.log(stdout , stderr);
  });
}

